<template>
  <div class="splitPeriodConfirm-wapper">
    <van-nav-bar title="分期信息确认" left-text="返回" left-arrow @click-left="onClickLeft" />
    <div class="splitPeriod-container">
      <div class="splitPeriod-info-card">
        <div class="info">
          <div class="title">分期金额（元）</div>
          <div class="number">500.00</div>
        </div>
        <div class="DottedLine"></div>
        <div class="flex-splitPeriod-info">
          <div class="wapper">
            <div class="desc">分期期数</div>
            <div class="value">36期</div>
          </div>
          <div class="wapper">
            <div class="desc">信用卡号</div>
            <div class="value">6227 **** **** 9366</div>
          </div>
          <div class="wapper">
            <div class="desc">利息支付方式</div>
            <div class="value">分期支付</div>
          </div>
          <div class="wapper">
            <div class="desc">还款计划</div>
            <div class="value">
              <div class="repayMent-value">
                首期应还 ￥ 17.39
                <span class="detail-btn">查看详情</span>
              </div>
              <div class="bottom">含利息 ￥3.50</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <feelingFixedButton @click="submitHandle">
      确认提交
      <template slot="argument">
        <div class="argument-wapper">
          <van-checkbox checked-color="#ee0a24" class="checkbox-wapper" v-model="checked"></van-checkbox>
          <div class="content">我已阅读同意 《xxx银行信用卡"账单分期业务条款及规则"》</div>
        </div>
      </template>
    </feelingFixedButton>
  </div>
</template>

<script>
import { Toast } from "vant";
import feelingFixedButton from "@/components/feelingFixedButton.vue";
export default {
  name: "index",
  components: { feelingFixedButton },
  data() {
    return {
      checked: false
    };
  },
  methods: {
    onClickLeft() {
      this.$router.back();
    },
    submitHandle() {
      if (!this.checked) {
        Toast.fail({
          message: "请先勾选协议"
        });
        return;
      }
      this.openWithPanel();
      setTimeout(() => {
        Toast.success({
          message: "提交成功"
        });
        this.hideWithPanel();
        this.$router.push("/splitPeriod");
      }, 1500);
    }
  }
};
</script>

<style lang='less' scoped>
.splitPeriodConfirm-wapper {
  height: 100vh;
  background-color: #f7f7f7;
  .splitPeriod-container {
    width: 100%;
    padding: 0.1rem 0.18rem 0 0.18rem;
    box-sizing: border-box;
    .splitPeriod-info-card {
      height: 3rem;
      background-color: #fff;
      border-radius: 0.1rem;
      box-sizing: border-box;
      text-align: center;
      padding: 0.5rem 0.1rem 0.2rem 0.1rem;
      .info {
        .title {
          margin-bottom: 0.08rem;
          color: #7c7c7c;
        }
        .number {
          font-size: 0.4rem;
          font-weight: 700;
        }
      }
      .DottedLine {
        width: 90%;
        border-top-width: 0.01rem;
        border-top-style: dashed;
        border-top-color: #ddd;
        margin: 0 auto;
        margin-top: 0.25rem;
      }
      .flex-splitPeriod-info {
        margin-top: 0.2rem;
        .wapper {
          height: 0.3rem;
          display: flex;
          justify-content: space-between;
          .desc {
            margin-right: 0.12rem;
            color: #939393;
          }
          .value {
            text-align: right;
            color: #000;
            .repayMent-value {
              .detail-btn {
                color: #f2721a;
              }
            }
            .bottom {
              font-size: 0.13rem;
              color: #a9a9a9;
              margin-top: 0.05rem;
            }
          }
        }
      }
    }
  }
  .argument-wapper {
    display: flex;
    margin-bottom: 0.15rem;
    .content {
      display: flex;
      align-items: center;
      margin-left: 0.05rem;
      font-size: 0.12rem;
    }
  }
}
</style>
